#include "sylar/head.h"

sylar::Logger::ptr g_logger = SYLAR_LOG_ROOT();

void test_fiber(){
    static int count = 5;
    SYLAR_LOG_INFO(g_logger) << "test in test_fiber count=" << count;
    sleep(1);
    if(--count >= 0){
        sylar::Scheduler::GetThis()->schedule(&test_fiber);
    }

}

int main(int argc, char** argv)
{
    SYLAR_LOG_INFO(g_logger) << "main";
    sylar::Scheduler sc(1, true, "test");
    sc.start();
    sleep(2);
    sc.schedule(&test_fiber);
    // sc.stop();
    SYLAR_LOG_INFO(g_logger) << "over";
    return 0;
}